package com.star.comtroller;

import com.star.entry.Enterprise;
import com.star.service.EnterpriseService;
import com.star.util.ResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SuppressWarnings("all")
@RestController
@RequestMapping("/enterprise/")
public class EnterpriseController {
    @Autowired
    private EnterpriseService enterpriseService;
    @Autowired
    private ResultObject result;


    @RequestMapping("selectByName")
    public ResultObject selectByName(String name){
        result.setStatus(400);
        result.setResult(enterpriseService.selectByName(name));

        return result;
    }
    @RequestMapping("selectById")
    public ResultObject selectById(int id){
        result.setStatus(400);
        result.setResult(enterpriseService.selectById(id));

        return result;
    }
    @RequestMapping("changeFollow")
    public ResultObject changeFollow(Enterprise enterprise){
        result.setStatus(400);
        result.setResult(enterpriseService.changeFollow(enterprise));
        return result;
    }


}
